<?php

namespace App\Http\Controllers\home;

use App\Model\answer;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;

class messageController extends Controller
{
    //
    public function show()
    {
        $List = answer::where('wid',session('writerid'))->get();
      
        return view('huweize.home.message',compact('List'));
    }

    public function del($id)
    {
        $result = answer::find($id);
        $result->delete();
        return redirect('huweize/home/message/'.session('writerid'));
    }
    public function delall($id)
    {
        $del = answer::where('wid',$id)->delete();
        return redirect('huweize/home/message/'.session('writerid'));
    }
}
